package com.lichuang.dedao.listenBooks.controller;


import com.lichuang.dedao.listenBooks.entity.Category;
import com.lichuang.dedao.listenBooks.entity.ListenBooks;
import com.lichuang.dedao.listenBooks.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 分类 前端控制器
 * </p>
 *
 * @author kangkang
 * @since 2019-07-13
 */
@RestController
@RequestMapping("//category")
public class CategoryController {

    @Autowired
    private ICategoryService categoryService;

    @RequestMapping("/selectCategory")
    public List<Category> selectCategory() {
        List<Category> categories = categoryService.selectCategory(-1);
        return categories;
    }

    @RequestMapping("/selectCategoryByListenBook")
    public List<Category> selectCategoryByListenBook(){
        return categoryService.selectCategoryByListenBook();
    }


}
